@@ -4,7 +4,6 @@ module Oauthable |
||
| 4 | 4 |
included do |base| |
| 5 | 5 |
attr_accessible :service_id |
| 6 | 6 |
validates_presence_of :service_id |
| 7 |
- base.extend ClassMethods |
|
| 8 | 7 |
self.class_variable_set(:@@valid_oauth_providers, :all) |
| 9 | 8 |
end |
| 10 | 9 |
|
@@ -1,10 +1,10 @@ |
||
| 1 | 1 |
class CreateServices < ActiveRecord::Migration |
| 2 | 2 |
def change |
| 3 | 3 |
create_table :services do |t| |
| 4 |
- t.integer :user_id |
|
| 5 |
- t.string :provider |
|
| 6 |
- t.string :name |
|
| 7 |
- t.text :token |
|
| 4 |
+ t.integer :user_id, null: false |
|
| 5 |
+ t.string :provider, null: false |
|
| 6 |
+ t.string :name, null: false |
|
| 7 |
+ t.text :token, null: false |
|
| 8 | 8 |
t.text :secret |
| 9 | 9 |
t.text :refresh_token |
| 10 | 10 |
t.datetime :expires_at |
@@ -24,7 +24,7 @@ class MigrateAgentsToServiceAuthentication < ActiveRecord::Migration |
||
| 24 | 24 |
secret: twitter_oauth_token_secret(agent) |
| 25 | 25 |
) |
| 26 | 26 |
agent.service_id = service.id |
| 27 |
- agent.save! |
|
| 27 |
+ agent.save!(validate: false) |
|
| 28 | 28 |
end |
| 29 | 29 |
if agents.length > 0 |
| 30 | 30 |
puts <<-EOF.strip_heredoc |